import 'package:kkhousekeep/generated/json/base/json_field.dart';
import 'package:kkhousekeep/generated/json/property_order_detail_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class PropertyOrderDetailEntity {
	late int code;
	late PropertyOrderDetailObj obj;
	late String msg;

	PropertyOrderDetailEntity();

	factory PropertyOrderDetailEntity.fromJson(Map<String, dynamic> json) => $PropertyOrderDetailEntityFromJson(json);

	Map<String, dynamic> toJson() => $PropertyOrderDetailEntityToJson(this);

	PropertyOrderDetailEntity copyWith({int? code, PropertyOrderDetailObj? obj, String? msg}) {
		return PropertyOrderDetailEntity()
			..code= code ?? this.code
			..obj= obj ?? this.obj
			..msg= msg ?? this.msg;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class PropertyOrderDetailObj {
	late int area;
	late String address;
	late String reporter;
	late String phone;
	late int urgency;
	late String fatalType;
	late String fatalDesc;
	late List<String> pics;
	late List<PropertyOrderDetailObjRecord> record;

	PropertyOrderDetailObj();

	factory PropertyOrderDetailObj.fromJson(Map<String, dynamic> json) => $PropertyOrderDetailObjFromJson(json);

	Map<String, dynamic> toJson() => $PropertyOrderDetailObjToJson(this);

	PropertyOrderDetailObj copyWith({int? area, String? address, String? reporter, String? phone, int? urgency, String? fatalType, String? fatalDesc, List<String>? pics, List<PropertyOrderDetailObjRecord>? record}) {
		return PropertyOrderDetailObj()
			..area= area ?? this.area
			..address= address ?? this.address
			..reporter= reporter ?? this.reporter
			..phone= phone ?? this.phone
			..urgency= urgency ?? this.urgency
			..fatalType= fatalType ?? this.fatalType
			..fatalDesc= fatalDesc ?? this.fatalDesc
			..pics= pics ?? this.pics
			..record= record ?? this.record;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class PropertyOrderDetailObjRecord {
	late String time;
	@JSONField(name: "operator")
	late String xOperator;
	late String operation;

	PropertyOrderDetailObjRecord();

	factory PropertyOrderDetailObjRecord.fromJson(Map<String, dynamic> json) => $PropertyOrderDetailObjRecordFromJson(json);

	Map<String, dynamic> toJson() => $PropertyOrderDetailObjRecordToJson(this);

	PropertyOrderDetailObjRecord copyWith({String? time, String? xOperator, String? operation}) {
		return PropertyOrderDetailObjRecord()
			..time= time ?? this.time
			..xOperator= xOperator ?? this.xOperator
			..operation= operation ?? this.operation;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}